#!/bin/bash

if [ -z $1 ]; then
	echo "请输入镜像名称"
	exit
fi

if [ -z $2 ]; then
	echo "请输入镜像版本"
	exit
fi

name=$1
version=$2

docker login -u cn-north-4@D6WB7LGJQYA1JHOHMNJP -p a4860567287669b953ce94c31a543b656dc12f298ecc8225b88264dbaea8e8ae swr.cn-north-4.myhuaweicloud.com

docker pull swr.cn-north-4.myhuaweicloud.com/cloud-quanhong/$name:$version

docker stop $name && docker rm $name

docker run -d --name $name swr.cn-north-4.myhuaweicloud.com/cloud-quanhong/$name:$version